home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 2040
- ClientLeft = 3525
- ClientTop = 4470
- ClientWidth = 3030
- Height = 2730
- Left = 3465
- LinkTopic = "Form1"
- ScaleHeight = 2040
- ScaleWidth = 3030
- Top = 3840
- Width = 3150
- Begin VB.CommandButton Command1
- Caption = "Hide Menus"
- Height = 495
- Left = 840
- TabIndex = 0
- Top = 600
- Width = 1215
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuHelp
- Caption = "&Help"
- Begin VB.Menu mnuHelpAbout
- Caption = "&About..."
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Declare Function SetMenu Lib "user32" (ByVal hwnd As Long, ByVal hMenu As Long) As Long
- Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
- Private Sub Command1_Click()
- Static hMenu As Long
- If hMenu = 0 Then
- ' Get the menu handle and hide the menu.
- hMenu = GetMenu(hwnd)
- SetMenu hwnd, 0
- Command1.Caption = "Show Menus"
- Else
- ' Restore the old menu.
- SetMenu hwnd, hMenu
- hMenu = 0
- Command1.Caption = "Hide Menus"
- End If
- End Sub
- Private Sub mnuFileExit_Click()
- Unload Me
- End Sub
- Private Sub mnuHelpAbout_Click()
- MsgBox "Click the button to hide/show the menus."
- End Sub
-